package com.prize.controller;

import com.prize.dtos.ResponseResult;
import com.prize.service.SysLogService;
import com.prize.system.apis.LogControllerApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = {"系统管理：日志管理控制类"})
@RestController
@RequestMapping("/api/v1/sysLog")
public class SysLogController implements LogControllerApi {

    @Autowired
    private SysLogService sysLogService;


    @ApiOperation(value = "日志列表")
    @PostMapping("/getLods")
    public ResponseResult getLods(@RequestParam(name = "username",required = false)String username,
                                  @RequestParam(name = "opContent",required = false)String opContent,
                                  @RequestParam(name = "ip",required = false)String ip,
                                  @RequestParam(name = "pageSize",required = true)int pageSize,
                                  @RequestParam(name = "pageNow",required = true)int  pageNow) {
        return sysLogService.getLods(username,opContent,ip,pageSize,pageNow);
    }
}
